package com.itheima.dao;

import com.itheima.domain.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface UserDao {
    @Select("select * from user")
    List<User> findAll();
    @Insert("insert into user(username,password)values(#{username},#{password})")
    void save(User user);
    @Delete("delete from user where id=#{id}")
    void delete(Integer sid);
    @Update("update user set username=#{username},password=#{password} where sid=#{sid}")
    void update(User user);
    @Select("select * from user where sid=#{sid}")
    User findById(Integer sid);

}
